package com.xiongwei.facade;

/**
 * 家庭影院Facade
 */
public class HomeTheaterFacade {
    //DVD
    private DVDPlayer dvdPlayer;
    //爆米花
    private Popcorn popcorn;
    //投影仪
    private Projector projector;

    public HomeTheaterFacade() {
        this.dvdPlayer = DVDPlayer.getInstance();
        this.popcorn = Popcorn.getInstance();
        this.projector = Projector.getInstance();
    }

    public void ready() {
        popcorn.on();
        dvdPlayer.on();
        projector.on();
    }

    public void end() {
        popcorn.off();
        dvdPlayer.off();
        projector.off();
    };

    public void play() {
        popcorn.pop();
        projector.focus();
        dvdPlayer.play();
    }

    public void pause() {
        dvdPlayer.pause();
    }
}
